cmake_minimum_required(VERSION 3.22)

project(resolver VERSION 1.0)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_STANDARD 11)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -pthread -W -Wall -Wextra")

include_directories(${PROJECT_SOURCE_DIR}/libuv/include)
include_directories(${PROJECT_SOURCE_DIR}/src)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src)

LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/libuv)

message(STATUS "PROJECT_SOURCE_DIR is " ${PROJECT_SOURCE_DIR})

set(resolver_source main.cpp )
list(APPEND resolver_source  
    src/FormatMessage.cpp
    src/MainController.cpp
    src/MessageQueue.cpp
    src/SessionHandler.cpp
    src/ThreadPool.cpp
    src/UDPHandler.cpp
    src/UDPServer.cpp
    src/Logger.cpp
    src/NanoLog.cpp
    src/DataParser.cpp)


add_executable(resolver ${resolver_source})

target_link_libraries(resolver libuv_a.a)


add_subdirectory(${PROJECT_SOURCE_DIR}/plugins/WriteToFilePlugin)
add_subdirectory(${PROJECT_SOURCE_DIR}/plugins/WriteToDBPlugin)